function request(url, params = {}, type = 'get') {
    return new Promise(function(resolve, reject) {
        $.ajax({
            type: type,
            url: url,
            data: {...params },
            dataType: 'json',
            success: function(data) {
                resolve(data);
            }
        })
    })
}
const select = params => request('../php/select.php', params, 'get');
const selectphone = params => request('../php/selectphone.php', params, 'get');
const selectemail = params => request('../php/selectemail.php', params, 'get');
const register = params => request('../php/register.php', params, 'get');
const account = params => request('../php/account.php', params, 'post');
const taobaogoods = params => request('../php/taobaogoods.php', params, 'get');
const detail = params => request('../php/detail.php', params, 'get');
// const prodata = params => request('../json/proData.json', params);
const addtoshoppingcar = params => request('../php/addtoshoppingcar.php', params, 'get');
const selectshopping = params => request('../php/selectshopping.php', params, 'get');
const reduceGoods = params => request('../php/updateshopping.php', { type: 0, ...params }, 'post');
const addGoods = params => request('../php/updateshopping.php', { type: 1, ...params }, 'post');
const changeGoods = params => request('../php/updateshopping.php', { type: 2, ...params }, 'post');

const delgoods = params => request('../php/delshopping.php', params, 'post');
const likeselect = params => request('../php/likeselect.php', params, 'get');
const sortselect = params => request('../php/sortselect.php', params, 'get');
const searchselectlimit = params => request('../php/searchselectlimit.php', params, 'get');